﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace GDFlacTool.Forms
{
    public partial class FormWaveCompression : Form
    {
        private string _waveCompression = string.Empty;

        public FormWaveCompression()
        {
            InitializeComponent();

            LoadFormatCombo();
        }

        public string WaveCompression
        {
            get { return _waveCompression; }
        }

        private void FormWaveCompression_Load(object sender, EventArgs e)
        {
            cboWaveFormat.SelectedIndex = Properties.AudioConverterSettings.Default.cboWaveFormat_SelectedIndex;
            cboWaveAttributes.SelectedIndex = Properties.AudioConverterSettings.Default.cboWaveAttributes_SelectedIndex;
        }

        private void FormWaveCompression_FormClosing(object sender, FormClosingEventArgs e)
        {
            Properties.AudioConverterSettings.Default.cboWaveFormat_SelectedIndex = cboWaveFormat.SelectedIndex;
            Properties.AudioConverterSettings.Default.cboWaveAttributes_SelectedIndex = cboWaveAttributes.SelectedIndex;
        }

        private void cboFormat_SelectedIndexChanged(object sender, EventArgs e)
        {
            cboWaveAttributes.Items.Clear();

            switch (cboWaveFormat.Text)
            {
                case "CCITT A-Law":
                    cboWaveAttributes.Items.AddRange(LoadCcittALaw().ToArray());
                    break;
                case "CCITT u-Law":
                    cboWaveAttributes.Items.AddRange(LoadCcittuLaw().ToArray());
                    break;
                case "GSM 6.10":
                    cboWaveAttributes.Items.AddRange(LoadGsm610().ToArray());
                    break;
                case "IMA ADPCM":
                    cboWaveAttributes.Items.AddRange(LoadImaAdpcm().ToArray());
                    break;
                case "Messenger Audio Codec":
                    cboWaveAttributes.Items.AddRange(LoadMessengerAudioCodec().ToArray());
                    break;
                case "Microsoft ADPCM":
                    cboWaveAttributes.Items.AddRange(LoadMicrosoftAdpcm().ToArray());
                    break;
                case "PCM":
                    cboWaveAttributes.Items.AddRange(LoadPcm().ToArray());
                    break;
                default:
                    cboWaveAttributes.Items.AddRange(LoadPcm().ToArray());
                    break;
            }
        }

        private void cboWaveAttributes_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (cboWaveFormat.Text)
            {
                case "CCITT A-Law":
                    _waveCompression = GetCcittALaw();
                    break;
                case "CCITT u-Law":
                    _waveCompression = GetCcittuLaw();
                    break;
                case "GSM 6.10":
                    _waveCompression = GetGsm610();
                    break;
                case "IMA ADPCM":
                    _waveCompression = GetImaAdpcm();
                    break;
                case "Messenger Audio Codec":
                    _waveCompression = GetMessengerAudioCodec();
                    break;
                case "Microsoft ADPCM":
                    _waveCompression = GetMicrosoftAdpcm();
                    break;
                case "PCM":
                    _waveCompression = GetPcm();
                    break;
                default:
                    _waveCompression = string.Empty;
                    break;
            }
        }

        #region Load Values To Attribute And Format Combo.

        private void LoadFormatCombo()
        {
            cboWaveFormat.Items.Add("CCITT A-Law");
            cboWaveFormat.Items.Add("CCITT u-Law");
            cboWaveFormat.Items.Add("GSM 6.10");
            cboWaveFormat.Items.Add("IMA ADPCM");
            cboWaveFormat.Items.Add("Messenger Audio Codec");
            cboWaveFormat.Items.Add("Microsoft ADPCM");
            cboWaveFormat.Items.Add("PCM");
        }

        private List<object> LoadCcittALaw()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       7 kb/sec",
                    "8.000 kHz; 8 Bit; Stereo     15 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      10 kb/sec",
                    "11.025 kHz; 8 Bit; Stereo    21 kb/sec",
                    "16.000 kHz; 8 Bit; Mono      15 kb/sec",
                    "16.000 kHz; 8 Bit; Stereo    31 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      21 kb/sec",
                    "22.050 kHz; 8 Bit; Stereo    43 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      43 kb/sec",
                    "44.100 kHz; 8 Bit; Stereo    86 kb/sec"
                };

            return attributes;
        }

        private List<object> LoadCcittuLaw()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       7 kb/sec",
                    "8.000 kHz; 8 Bit; Stereo     15 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      10 kb/sec",
                    "11.025 kHz; 8 Bit; Stereo    21 kb/sec",
                    "16.000 kHz; 8 Bit; Mono      15 kb/sec",
                    "16.000 kHz; 8 Bit; Stereo    31 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      21 kb/sec",
                    "22.050 kHz; 8 Bit; Stereo    43 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      43 kb/sec",
                    "44.100 kHz; 8 Bit; Stereo    86 kb/sec"
                };

            return attributes;
        }

        private List<object> LoadGsm610()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       1 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      2 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      4 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      8 kb/sec"
                };

            return attributes;
        }

        private List<object> LoadImaAdpcm()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       3 kb/sec",
                    "8.000 kHz; 8 Bit; Stereo     7 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      5 kb/sec",
                    "11.025 kHz; 8 Bit; Stereo    10 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      10 kb/sec",
                    "22.050 kHz; 8 Bit; Stereo    21 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      21 kb/sec",
                    "44.100 kHz; 8 Bit; Stereo    43 kb/sec"
                };

            return attributes;
        }

        private List<object> LoadMessengerAudioCodec()
        {
            var attributes = new List<object> {"16.000 kHz; Mono             1 kb/sec"};

            return attributes;
        }

        private List<object> LoadMicrosoftAdpcm()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       4 kb/sec",
                    "8.000 kHz; 8 Bit; Stereo     8 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      5 kb/sec",
                    "11.025 kHz; 8 Bit; Stereo    11 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      10 kb/sec",
                    "22.050 kHz; 8 Bit; Stereo    21 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      21 kb/sec",
                    "44.100 kHz; 8 Bit; Stereo    43 kb/sec"
                };

            return attributes;
        }

        private List<object> LoadPcm()
        {
            var attributes = new List<object>
                {
                    "8.000 kHz; 8 Bit; Mono       7 kb/sec",
                    "8.000 kHz; 8 Bit; Stereo     15 kb/sec",
                    "8.000 kHz; 16 Bit; Mono      15 kb/sec",
                    "8.000 kHz; 16 Bit; Stereo    31 kb/sec",
                    "11.025 kHz; 8 Bit; Mono      10 kb/sec",
                    "11.025 kHz; 8 Bit; Stereo    21 kb/sec",
                    "11.025 kHz; 16 Bit; Mono     21 kb/sec",
                    "11.025 kHz; 16 Bit; Stereo   43 kb/sec",
                    "12.000 kHz; 8 Bit; Mono      11 kb/sec",
                    "12.000 kHz; 8 Bit; Stereo    23 kb/sec",
                    "12.000 kHz; 16 Bit; Mono     23 kb/sec",
                    "12.000 kHz; 16 Bit; Stereo   46 kb/sec",
                    "16.000 kHz; 8 Bit; Mono      15 kb/sec",
                    "16.000 kHz; 8 Bit; Stereo    31 kb/sec",
                    "16.000 kHz; 16 Bit; Mono     31 kb/sec",
                    "16.000 kHz; 16 Bit; Stereo   62 kb/sec",
                    "22.050 kHz; 8 Bit; Mono      21 kb/sec",
                    "22.050 kHz; 8 Bit; Stereo    43 kb/sec",
                    "22.050 kHz; 16 Bit; Mono     43 kb/sec",
                    "22.050 kHz; 16 Bit; Stereo   86 kb/sec",
                    "24.000 kHz; 8 Bit; Mono      23 kb/sec",
                    "24.000 kHz; 8 Bit; Stereo    46 kb/sec",
                    "24.000 kHz; 16 Bit; Mono     46 kb/sec",
                    "24.000 kHz; 16 Bit; Stereo   93 kb/sec",
                    "32.000 kHz; 8 Bit; Mono      31 kb/sec",
                    "32.000 kHz; 8 Bit; Stereo    62 kb/sec",
                    "32.000 kHz; 16 Bit; Mono     62 kb/sec",
                    "32.000 kHz; 16 Bit; Stereo   125 kb/sec",
                    "44.100 kHz; 8 Bit; Mono      43 kb/sec",
                    "44.100 kHz; 8 Bit; Stereo    86 kb/sec",
                    "44.100 kHz; 16 Bit; Mono     86 kb/sec",
                    "44.100 kHz; 16 Bit; Stereo   172 kb/sec",
                    "48.000 kHz; 8 Bit; Mono      46 kb/sec",
                    "48.000 kHz; 8 Bit; Stereo    93 kb/sec",
                    "48.000 kHz; 16 Bit; Mono     93 kb/sec",
                    "48.000 kHz; 16 Bit; Stereo   187 kb/sec"
                };

            return attributes;
        }

        #endregion

        #region Get Values From Selected Combos

        private string GetCcittALaw()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       7 kb/sec":
                    value = "06000100401F0000401F0000010008000000";
                    break;
                case "8.000 kHz; 8 Bit; Stereo     15 kb/sec":
                    value = "06000200401F0000803E0000020008000000";
                    break;
                case "11.025 kHz; 8 Bit; Mono      10 kb/sec":
                    value = "06000100112B0000112B0000010008000000";
                    break;
                case "11.025 kHz; 8 Bit; Stereo    21 kb/sec":
                    value = "06000200112B000022560000020008000000";
                    break;
                case "16.000 kHz; 8 Bit; Mono      15 kb/sec":
                    value = "06000100803E0000803E0000010008000000";
                    break;
                case "16.000 kHz; 8 Bit; Stereo    31 kb/sec":
                    value = "06000200803E0000007D0000020008000000";
                    break;
                case "22.050 kHz; 8 Bit; Mono      21 kb/sec":
                    value = "060001002256000022560000010008000000";
                    break;
                case "22.050 kHz; 8 Bit; Stereo    43 kb/sec":
                    value = "060002002256000044AC0000020008000000";
                    break;
                case "44.100 kHz; 8 Bit; Mono      43 kb/sec":
                    value = "0600010044AC000044AC0000010008000000";
                    break;
                case "44.100 kHz; 8 Bit; Stereo    86 kb/sec":
                    value = "0600020044AC000088580100020008000000";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetCcittuLaw()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       7 kb/sec":
                    value = "07000100401F0000401F0000010008000000";
                    break;
                case "8.000 kHz; 8 Bit; Stereo     15 kb/sec":
                    value = "07000200401F0000803E0000020008000000";
                    break;
                case "11.025 kHz; 8 Bit; Mono      10 kb/sec":
                    value = "07000100112B0000112B0000010008000000";
                    break;
                case "11.025 kHz; 8 Bit; Stereo    21 kb/sec":
                    value = "07000200112B000022560000020008000000";
                    break;
                case "16.000 kHz; 8 Bit; Mono      15 kb/sec":
                    value = "07000100803E0000803E0000010008000000";
                    break;
                case "16.000 kHz; 8 Bit; Stereo    31 kb/sec":
                    value = "07000200803E0000007D0000020008000000";
                    break;
                case "22.050 kHz; 8 Bit; Mono      21 kb/sec":
                    value = "070001002256000022560000010008000000";
                    break;
                case "22.050 kHz; 8 Bit; Stereo    43 kb/sec":
                    value = "070002002256000044AC0000020008000000";
                    break;
                case "44.100 kHz; 8 Bit; Mono      43 kb/sec":
                    value = "0700010044AC000044AC0000010008000000";
                    break;
                case "44.100 kHz; 8 Bit; Stereo    86 kb/sec":
                    value = "0700020044AC000088580100020008000000";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetGsm610()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       1 kb/sec":
                    value = "31000100401F0000590600004100000002004001";
                    break;
                case "11.025 kHz; 8 Bit; Mono      2 kb/sec":
                    value = "31000100112B0000BF0800004100000002004001";
                    break;
                case "22.050 kHz; 8 Bit; Mono      4 kb/sec":
                    value = "31000100225600007E1100004100000002004001";
                    break;
                case "44.100 kHz; 8 Bit; Mono      8 kb/sec":
                    value = "3100010044AC0000FD2200004100000002004001";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetImaAdpcm()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       3 kb/sec":
                    value = "11000100401F0000D70F0000000104000200F901";
                    break;
                case "8.000 kHz; 8 Bit; Stereo     7 kb/sec":
                    value = "11000200401F0000AE1F0000000204000200F901";
                    break;
                case "11.025 kHz; 8 Bit; Mono      5 kb/sec":
                    value = "11000100112B0000D4150000000104000200F901";
                    break;
                case "11.025 kHz; 8 Bit; Stereo    10 kb/sec":
                    value = "11000200112B0000A92B0000000204000200F901";
                    break;
                case "22.050 kHz; 8 Bit; Mono      10 kb/sec":
                    value = "11000100225600005C2B0000000204000200F903";
                    break;
                case "22.050 kHz; 8 Bit; Stereo    21 kb/sec":
                    value = "1100020022560000B9560000000404000200F903";
                    break;
                case "44.100 kHz; 8 Bit; Mono      21 kb/sec":
                    value = "1100010044AC00006D560000000404000200F907";
                    break;
                case "44.100 kHz; 8 Bit; Stereo    43 kb/sec":
                    value = "1100020044AC0000DBAC0000000804000200F907";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetMessengerAudioCodec()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "16.000 kHz; Mono             1 kb/sec":
                    value = "8E020100803E0000D00700002800000002000000";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetMicrosoftAdpcm()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       4 kb/sec":
                    value = "02000100401F000000100000000104002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "8.000 kHz; 8 Bit; Stereo     8 kb/sec":
                    value = "02000200401F000000200000000204002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 8 Bit; Mono      5 kb/sec":
                    value = "02000100112B00000C160000000104002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 8 Bit; Stereo    11 kb/sec":
                    value = "02000200112B0000192C0000000204002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 8 Bit; Mono      10 kb/sec":
                    value = "0200010022560000932B0000000204002000F403070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 8 Bit; Stereo    21 kb/sec":
                    value = "020002002256000027570000000404002000F403070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 8 Bit; Mono      21 kb/sec":
                    value = "0200010044AC0000A3560000000404002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 8 Bit; Stereo    43 kb/sec":
                    value = "0200020044AC000047AD0000000804002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        private string GetPcm()
        {
            string value;

            switch (cboWaveAttributes.Text)
            {
                case "8.000 kHz; 8 Bit; Mono       7 kb/sec":
                    value = "01000100401F0000401F0000010008002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "8.000 kHz; 8 Bit; Stereo     15 kb/sec":
                    value = "01000200401F0000803E0000020008002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "8.000 kHz; 16 Bit; Mono      15 kb/sec":
                    value = "01000100401F0000803E0000020010002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "8.000 kHz; 16 Bit; Stereo    31 kb/sec":
                    value = "01000200401F0000007D0000040010002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 8 Bit; Mono      10 kb/sec":
                    value = "01000100112B0000112B0000010008002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 8 Bit; Stereo    21 kb/sec":
                    value = "01000200112B000022560000020008002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 16 Bit; Mono     21 kb/sec":
                    value = "01000100112B000022560000020010002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "11.025 kHz; 16 Bit; Stereo   43 kb/sec":
                    value = "01000200112B000044AC0000040010002000F407070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "12.000 kHz; 8 Bit; Mono      11 kb/sec":
                    value = "01000100E02E0000E02E0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "12.000 kHz; 8 Bit; Stereo    23 kb/sec":
                    value = "01000200E02E0000C05D0000020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "12.000 kHz; 16 Bit; Mono     23 kb/sec":
                    value = "01000100E02E0000C05D0000020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "12.000 kHz; 16 Bit; Stereo   46 kb/sec":
                    value = "01000200E02E000080BB0000040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "16.000 kHz; 8 Bit; Mono      15 kb/sec":
                    value = "01000100803E0000803E0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "16.000 kHz; 8 Bit; Stereo    31 kb/sec":
                    value = "01000200803E0000007D0000020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "16.000 kHz; 16 Bit; Mono     31 kb/sec":
                    value = "01000100803E0000007D0000020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "16.000 kHz; 16 Bit; Stereo   62 kb/sec":
                    value = "01000200803E000000FA0000040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 8 Bit; Mono      21 kb/sec":
                    value = "010001002256000022560000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 8 Bit; Stereo    43 kb/sec":
                    value = "010002002256000044AC0000020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 16 Bit; Mono     43 kb/sec":
                    value = "010001002256000044AC0000020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "22.050 kHz; 16 Bit; Stereo   86 kb/sec":
                    value = "010002002256000088580100040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "24.000 kHz; 8 Bit; Mono      23 kb/sec":
                    value = "01000100C05D0000C05D0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "24.000 kHz; 8 Bit; Stereo    46 kb/sec":
                    value = "01000200C05D000080BB0000020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "24.000 kHz; 16 Bit; Mono     46 kb/sec":
                    value = "01000100C05D000080BB0000020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "24.000 kHz; 16 Bit; Stereo   93 kb/sec":
                    value = "01000200C05D000000770100040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "32.000 kHz; 8 Bit; Mono      31 kb/sec":
                    value = "01000100007D0000007D0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "32.000 kHz; 8 Bit; Stereo    62 kb/sec":
                    value = "01000200007D000000FA0000020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "32.000 kHz; 16 Bit; Mono     62 kb/sec":
                    value = "01000100007D000000FA0000020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "32.000 kHz; 16 Bit; Stereo   125 kb/sec":
                    value = "01000200007D000000F40100040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 8 Bit; Mono      43 kb/sec":
                    value = "0100010044AC000044AC0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 8 Bit; Stereo    86 kb/sec":
                    value = "0100020044AC000088580100020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 16 Bit; Mono     86 kb/sec":
                    value = "0100010044AC000088580100020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "44.100 kHz; 16 Bit; Stereo   172 kb/sec":
                    value = "0100020044AC000010B10200040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "48.000 kHz; 8 Bit; Mono      46 kb/sec":
                    value = "0100010080BB000080BB0000010008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "48.000 kHz; 8 Bit; Stereo    93 kb/sec":
                    value = "0100020080BB000000770100020008002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "48.000 kHz; 16 Bit; Mono     93 kb/sec":
                    value = "0100010080BB000000770100020010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                case "48.000 kHz; 16 Bit; Stereo   187 kb/sec":
                    value = "0100020080BB000000EE0200040010002000F401070000010000000200FF00000000C0004000F0000000CC0130FF880118FF";
                    break;
                default:
                    value = string.Empty;
                    break;
            }

            return string.Format("-acm=\"{0}\"", value);
        }

        #endregion

        private void btnOK_Click(object sender, EventArgs e)
        {

        }

        
    }
}
